// sd_liferuning/pages/constmer/price-breakdown/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    money: '0.00',
    price: '0.00',
    vipprice: '0.00',
    integral: '0.00',
    lastPrice:'0.00'
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var money = Number(options.money)
    var vipprice = Number(options.vipprice) / 100 * money;
    var that=this;
    if (options.money == 0 || options.money == NaN){
      that.setData({
        money: 0.00,
      })
    }else{
      that.setData({
        money: options.money,
      })
    }
    if (options.price == 0 || options.price == NaN) {
      that.setData({
        price: 0.00,
      })
    } else {
      that.setData({
        price: options.price,
      })
    }
    if (options.vipprice == 0 || options.vipprice == NaN) {
      that.setData({
        vipprice: 0.00,
      })
    } else {
      that.setData({
        vipprice: options.vipprice,
      })
    }
    if (options.integral == 0 || options.integral == NaN) {
      that.setData({
        integral: 0.00,
      })
    } else {
      that.setData({
        integral: options.integral,
      })
    }
    if (options.lastPrice == 0 || options.lastPrice == NaN) {
      that.setData({
        lastPrice: 0.00,
      })
    } else {
      that.setData({
        lastPrice: options.lastPrice,
      })
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  }
})